﻿@{
    <!--ViewBag.Title = "VizrtPage";-->
    <!--Layout = "~/Views/Shared/_LayoutPage1.cshtml";-->
    Layout = null;
}

<h2>VizrtPage</h2>
<div class="story_menu"> 
   <form style="padding-left: 40px;" method="post" action="/Home/Career" >
       <input type="hidden" name="ID" value="2222222222222212" />
        Email: <input type="text" name="email"><br>
        <!--Last name: <input type="text" name="lastname">-->
        
        <div style="padding-bottom:40px; padding-top:10px; padding-left:100px;"><input type="submit" value="Submit" style="height: 30px;width:  120px; border: 0px solid black; -moz-border-radius: 10px;border-radius: 10px;background-color: skyblue;" onclick=""/></div>

       <button type="button" value="Get Time from Server" onclick="SendAjaxRequest();">Get Time from Server</button>
   </form>
    
</div>

Server Time Is: <div id="myTime"> @DateTime.Now.ToString("dd MMMM, yyyy hh:mm::ss") </div>


<script language="javascript" type="text/javascript">

    function SendAjaxRequest() {
        var xmlhttp;

        if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
            //alert("NON IE");
            xmlhttp = new XMLHttpRequest();
        }
        else {// code for IE6, IE5
            //alert("IE")
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }

        

        xmlhttp.open("POST", "/Home/GetServerTime", true); 

        
        xmlhttp.send();


        xmlhttp.onreadystatechange = function () {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                //document.getElementById("myTime").innerHTML = xmlhttp.responseText;
                alert('Server Response Is: ' + xmlhttp.responseText);
            }
        }

    }
</script>